#define _CRT_SECURE_NO_WARNINGS 1

int* printNumbers(int n, int* returnSize) {
    // write code here
    int max = 0;
    for (int i = 1, j = 1; i <= n; ++i)
    {
        max += j * 9;
        j *= 10;
    }
    int* arr = (int*)malloc(sizeof(int) * max);
    *returnSize = max;
    for (int i = 0; i < max; ++i)
    {
        arr[i] = i + 1;
    }
    return arr;
}